package com.ruoyi.fantasy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fantasy.mapper.FantasyUserAbilityMapper;
import com.huanzhidadi.fantasy.bean.domain.FantasyUserAbility;
import com.ruoyi.fantasy.service.IFantasyUserAbilityService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户能力Service业务层处理
 * 
 * @author wanghui
 * @date 2020-04-11
 */
@Service
public class FantasyUserAbilityServiceImpl implements IFantasyUserAbilityService 
{
    @Autowired
    private FantasyUserAbilityMapper fantasyUserAbilityMapper;

    /**
     * 查询用户能力
     * 
     * @param id 用户能力ID
     * @return 用户能力
     */
    @Override
    public FantasyUserAbility selectFantasyUserAbilityById(String id)
    {
        return fantasyUserAbilityMapper.selectFantasyUserAbilityById(id);
    }

    /**
     * 查询用户能力列表
     * 
     * @param fantasyUserAbility 用户能力
     * @return 用户能力
     */
    @Override
    public List<FantasyUserAbility> selectFantasyUserAbilityList(FantasyUserAbility fantasyUserAbility)
    {
        return fantasyUserAbilityMapper.selectFantasyUserAbilityList(fantasyUserAbility);
    }

    /**
     * 新增用户能力
     * 
     * @param fantasyUserAbility 用户能力
     * @return 结果
     */
    @Override
    public int insertFantasyUserAbility(FantasyUserAbility fantasyUserAbility)
    {
        fantasyUserAbility.setCreateTime(DateUtils.getNowDate());
        return fantasyUserAbilityMapper.insertFantasyUserAbility(fantasyUserAbility);
    }

    /**
     * 修改用户能力
     * 
     * @param fantasyUserAbility 用户能力
     * @return 结果
     */
    @Override
    public int updateFantasyUserAbility(FantasyUserAbility fantasyUserAbility)
    {
        fantasyUserAbility.setUpdateTime(DateUtils.getNowDate());
        return fantasyUserAbilityMapper.updateFantasyUserAbility(fantasyUserAbility);
    }

    /**
     * 删除用户能力对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFantasyUserAbilityByIds(String ids)
    {
        return fantasyUserAbilityMapper.deleteFantasyUserAbilityByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户能力信息
     * 
     * @param id 用户能力ID
     * @return 结果
     */
    @Override
    public int deleteFantasyUserAbilityById(String id)
    {
        return fantasyUserAbilityMapper.deleteFantasyUserAbilityById(id);
    }
}
